<template>
        <div class="vehicle_application">
          <div class="vehicleForm">
            <el-row >
              <el-col :span="24">
                <div style="border-bottom: 1px solid gainsboro">
                  <span><h1 class="bg-purple-dark">聘用邀请</h1></span>
                </div>
              </el-col>
              <!--             聘用邀请内容-->
              <div class="vehicleForm_1">
                <div style="width: 700px;margin-left: 77px">
                亲爱的<span style="text-decoration: underline">{{d.interviName}}</span>:
                <br>
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在招聘过程中，你的表现证明了你是我们公司<span style="text-decoration: underline">{{d.jobdemandName}}</span>岗位想要聘用的人。谨此向你发出聘用邀请，以下是有关聘用的要点:
                <br>
                1.入职报到日期:<span style="text-decoration: underline">{{str2}}</span>上午10点,地点:<span style="text-decoration: underline">株洲市荷塘区石宋路1059中科韬睿右栋大楼二楼</span>
                <br>
                2.试用期六个月，试用期薪水是税前人民币<span style="text-decoration: underline"><el-input v-model="d.jobrecordSalary2" style="width: 80px;height: 20px"/></span>元/月;考核转正后薪水是税前人民币<span style="text-decoration: underline"><el-input v-model="d.jobrecordSalary" style="width: 80px;height: 20px"  @keyup.enter="JobMohu()"/></span>元/月。薪水将在每月10号转入你的中国农业银行的银行卡里。请只向公司提供你的银行帐号，用于发薪水。除此之外，不要随便把账号告诉他人或把存折交给他人。
                <br>
                3.开发工程师岗位的奖金与考核指标挂钩。薪水是保密的。
                <br>
                4.根据工作需要，提供相关的培训机会。
                <br>
                5.入职请提供以下材料:
               <p>A、上家单位的离职证明</p>
                <p>  B、本人身份证原件或复印件</p>
                <p> C、学历证明原件或复印件</p>
                <p> D、上海户口还需提交《劳动手册》或《就业失业登记证明》</p>
                <p> E、公积金账号</p>
                <p> 十分希望你加入我们公司，并成为这个优秀队伍中的一员。</p>
                <p>{{str2}}</p>
              </div>
              </div>
            </el-row>
          </div>
          <el-col>
            <el-button type="primary" @click="save()">确定发送</el-button> <el-button style="width:88px" @click="leave()">取消</el-button>
          </el-col>
          </div>
</template>

<script lang="ts" setup>
import {reactive, ref, onMounted, onBeforeMount} from 'vue'
import type { FormInstance } from 'element-plus'
import { Edit } from '@element-plus/icons-vue'
import {ElMessage} from 'element-plus'
import {Plus} from '@element-plus/icons-vue'
import type {TabsPaneContext, UploadProps} from 'element-plus'
import {useRouter} from "vue-router";
import router from "../../router";
import moment from "moment";
import axios from "axios";
const d = reactive({
  //初始数据
  interviName:'',
  interviPhone:'',
  jobdemandName:'',
  jobrecordSalary:'',
  jobrecordSalary2:'',
})
let route=useRouter()
let ss=route.currentRoute.value.query
d.interviName=ss.id
d.interviPhone=ss.phone
d.jobdemandName=ss.job
let str = moment(new Date()).format("YYYY年MM月")
let str2 = moment(new Date()).format("YYYY年MM月DD日")
//定义搜索数据
let str3 = moment(new Date()).format("YYYY-MM-DD hh:mm:ss")
//返回
const leave = () => {
  router.push({path: '/interview'})
}
//查询薪资
const resumeJOB = () => {
  axios.post("http://localhost:1688/jobre/selectJob/"+d.jobdemandName).then((res)=>{
    d.jobrecordSalary=res.data.data[0].jobrecordSalary
    let aa=d.jobrecordSalary*0.8
    d.jobrecordSalary2=aa;
    console.log(res.data.data)
  })
}
const onboar=reactive({
  interviName:'',
  jobdemandName:'',
  personnelPhone:'',
  inductionDate:str3,
  inductionSteta:0,
  inductionSalary:'',
  deptId:'',
})

//确定发送
const save = () => {
  onboar.interviName= d.interviName;
  onboar.personnelPhone=d.interviPhone;
  onboar.jobdemandName=d.jobdemandName;
  onboar.inductionSalary=d.jobrecordSalary;
  console.log(onboar)
  axios.post("http://localhost:9884/inductions/addinduction",onboar).then((res)=>{
    router.push({path: '/onboarding'})
  })

}
//试用薪资变化
const JobMohu = () => {
  let aa=d.jobrecordSalary*0.8
  d.jobrecordSalary2=aa;
  console.log("变化")
}
onBeforeMount(function () {
  resumeJOB()
})
</script>
<style>

.bg-purple-dark {
  position: relative;
  display: flex;
  justify-content: center;
  margin-left: -40px;
}

.vehicle_application{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.vehicleForm_1{

}
</style>
